
(()=>{
    // 定义接口
    interface persong{
        firstname:string
        lastname:string
    }

    // 类
    class Person{
        // 共用字段
        firstname:string
        lastname:string
        fullname:string

        constructor (firstname:string, lastname:string){
            this.firstname = firstname
            this.lastname = lastname
            this.fullname = this.firstname + '_' + this.lastname
        }
    }

    // 定义函数
    function Showfullname(person:persong){
        return person.firstname + '_' + person.lastname
    }

    const person = new Person('zz','aa')
    console.log(Showfullname(person))
})()